package com.xb.loan.admin.service.monitor.impl;

import com.xb.loan.admin.bean.system.OssOperateLog;
import com.xb.loan.admin.dao.system.OssOperateLogDao;
import com.xb.loan.admin.service.monitor.OssOperateLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service("ossOperateLogService")
public class OssOperateLogServiceImpl implements OssOperateLogService {

//	private final static String SYS_ERROR = "系统异常";
//	private final static String PARAM_ERROR = "参数错误";
//	private final static String LOGIN_NAME_EXIST = "已存在";
//	
//	private int res = 0;
	
	@Autowired
	private OssOperateLogDao ossOperateLogDao;
	

	@Override
	public List<OssOperateLog> queryOssOperateLogPage(int pageSize, int pageNum, String operatorId, int operateType, String startTime, String endTime){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("pageSize", pageSize);
		map.put("pageNum", pageNum);
		map.put("operatorId", operatorId);
		map.put("operateType", operateType);
		map.put("startTime", startTime);
		map.put("endTime", endTime + " 23:59:59");
		return ossOperateLogDao.queryOssOperateLogPage(map);
	}
	
	@Override
	public int queryOssOperateLogCount(String operatorId,int operateType,String startTime,String endTime){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("operatorId", operatorId);
		map.put("operateType", operateType);
		map.put("startTime", startTime);
		map.put("endTime", endTime + " 23:59:59");
		return ossOperateLogDao.queryOssOperateLogCount(map);
	}
	
	@Override
    public int insertOssOperateLog(OssOperateLog ossOperateLog){
		return ossOperateLogDao.insert(ossOperateLog);
	}
	@Override
	public List<Map<String, Object>> queryOssOperateLogMap(int pageSize,int pageNum,String operatorId,int operateType,String startTime,String endTime){
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("pageSize", pageSize);
		map.put("pageNum", pageNum);
		map.put("operatorId", operatorId);
		map.put("operateType", operateType);
		map.put("startTime", startTime);
		map.put("endTime", endTime + " 23:59:59");
		return ossOperateLogDao.queryOssOperateLogMap(map);
	}
}
